package com.ht.module.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import jakarta.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;


/**
 * <p>
 * 
 * </p>
 *
 * @author Auto-generator
 * @since 2021-04-27
 */

@TableName("sys_user")
@Data
@Accessors(chain = true)
public class SysUser implements  Serializable{

    @TableId
    private String id;

    @Schema(description ="用户名")
    @NotBlank
    private String username;

    @Schema(description ="密码")
    private String password;

    @Schema(description ="昵称")
    @NotBlank
    private String name;

    @Schema(description ="所属部门")
    @NotBlank
    private String deptId;

    @Schema(description ="字段状态：01:启用：02：禁用  -关联码表state")
    @NotBlank
    private String state;


    @Schema(description ="头像")
    private String avatar;


    @Schema(description ="电话号码")
    private String phone;

    @Schema(description ="性别")
    private String sex;

    @Schema(description ="微信小程序openID")
    private String openId;

    @Schema(description ="用户在开放平台的唯一标识符")
    private String unionId;

    
    @Schema(description ="创建时间")
    private LocalDateTime createDate;
    
    @Schema(description ="创建人")
    private String createUser;

    
    @Schema(description ="修改时间")
    private LocalDateTime updateDate;

    
    @Schema(description ="修改人")
    private String updateUser;

    
    @Schema(description ="角色名拼接字符串")
    @TableField(exist = false)
    private String roleNames;

    @Schema(description ="用户菜单")
    @TableField(exist = false)
    private List<SysMenu> sysMenus;


    
    @Schema(description ="用户菜单不是树")
    @TableField(exist = false)
    private List<SysMenu> sysMenusNoTree;

    
    @Schema(description ="用户按钮权限")
    @TableField(exist = false)
    private List<SysMenu> permissions;

    
    @Schema(description ="用户角色id集合")
    @TableField(exist = false)
    private List<String> roles;

    
    @Schema(description ="用户角色集合")
    @TableField(exist = false)
    private List<SysRole> roleObjs;

    
    @Schema(description ="用户创建月份")
    @TableField(exist = false)
    private Integer createMonth;

    
    @Schema(description ="部门名称")
    @TableField(exist = false)
    private String deptName;

    @Schema(description ="用户编码集合")
    @TableField(exist = false)
    private String roleCodes;

    @Schema(description ="角色id拼接字符串")
    @TableField(exist = false)
    private String roleIds;
}
